﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="SurveyItemList.aspx.cs" Inherits="Maticsoft.Web.Admin.Feedback.SurveyItemList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
    $(function () {
        $("#chk_all").click(function () {
            $("input[name=chk_list]").each(function () {
                $(this).attr("checked", true);
            })
        });
        $("#chk_no").click(function () {
            $("input[name=chk_list]").each(function () {
                $(this).attr("checked", false);
            })
        })
    })
    function Del() {
        var ids = "";
        $("#lists input:checkbox").each(function () {
            if ($(this).attr("checked") == true) {
                if (ids.length > 0) {
                    ids += ",";
                }
                ids += $(this).val();
            }
        })
        if (ids.length > 0) {
            if (confirm("确认删除？")) {
                $("#ctl00_ContentPlaceHolder1_txtIds").val(ids);
                return true;
            }
            else {
                return false;
            }
        }
        else {
            alert("请选择要删除记录");
            return false;
        }
    }
    </script>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111"
        style="border-collapse: collapse">
        <tr>
            <td width="100%" height="20" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="30">
                            <img height="14" src="../images/book1.gif" width="20">&nbsp;反馈&nbsp;&gt;&gt;&nbsp;反馈管理&nbsp;&gt;&gt;&nbsp;问卷调查
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" height="1" background="../images/sp_bg.gif">
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="10">
            </td>
        </tr>
    </table>
    <!--  快速转换位置按钮  -->
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ccd9b9" align="center">
        <tr>
            <td height="26" background="../images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="left">
                            &nbsp;<asp:Button ID="Button1" runat="server" 
                                Text="添加" CssClass="coolbg np" onclick="Button1_Click" />&nbsp;<asp:Button ID="Button4" runat="server" 
                                Text="返回" CssClass="coolbg np" onclick="Button4_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="editT" visible="false" runat="server">
        <tr>
            <td height="30" width="5%" align="right">
            标题：
            </td>
            <td align="left">
                <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox> <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle" ErrorMessage="添加标题" Display="Dynamic" ValidationGroup="m"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td height="30" width="5%" align="right">
            类型：
            </td>
            <td align="left">
                <asp:DropDownList ID="ddlItemType" runat="server">
                <asp:ListItem Value="-1" Text="请选择"></asp:ListItem>
                <asp:ListItem Value="1" Text="单选"></asp:ListItem>
                <asp:ListItem Value="2" Text="多选"></asp:ListItem>
                <asp:ListItem Value="3" Text="填空"></asp:ListItem>
                </asp:DropDownList> <asp:RegularExpressionValidator
                        ID="RegularExpressionValidator2" ControlToValidate="ddlItemType" runat="server" ValidationExpression="[1-9]" ErrorMessage="请选择类型" Display="Dynamic" ValidationGroup="m"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td height="30" align="right">
            排序：
            </td>
            <td align="left">
                <asp:TextBox ID="txtOrderNo" runat="server"></asp:TextBox> <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtOrderNo" ErrorMessage="添加排序" Display="Dynamic" ValidationGroup="m"></asp:RequiredFieldValidator><asp:RegularExpressionValidator
                        ID="RegularExpressionValidator1" ControlToValidate="txtOrderNo" runat="server" ValidationExpression="[0-9]" ErrorMessage="请添加0-9之间数字" Display="Dynamic" ValidationGroup="m"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td height="30">
            </td>
            <td align="left">
                <asp:HiddenField ID="hidSurveyOptionId" runat="server" />
                <asp:Button ID="Button3" runat="server"  CssClass="coolbg np" Text="提交" 
                    onclick="Button3_Click" ValidationGroup="m" /> &nbsp;<asp:Button ID="Button2" runat="server"  CssClass="coolbg np" Text="取消" 
                    onclick="Button2_Click" />
            </td>
        </tr>
    </table>
    <!--  内容列表   -->
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center"
        style="margin-top: 8px" id="lists">
        <tr bgcolor="#E7E7E7">
            <td height="28" colspan="7" background="../images/tbg.gif" 
                style="padding-left: 10px;">
                ◆ 标题列表
            </td>
        </tr>
        <tr align="center" bgcolor="#FBFCE2">
            <td width="4%">
                选择
            </td>
            <td width="6%">
                ID
            </td>
            <td>
                标题
            </td>
            <td width="8%">
                排序
            </td>
            <td width="8%">
                类型
            </td>
            <td width="14%">
                添加时间
            </td>
            <td width="8%">
                操作
            </td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server"
         onitemcommand="Repeater1_ItemCommand">
            <ItemTemplate>
                <tr align='center' bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';"
                    onmouseout="javascript:this.bgColor='#FFFFFF';">
                    <td>
                        <input name="chk_list" type="checkbox" id="chk_list" class="np" value="<%#Eval("SurveyId") %>" />
                    </td>
                    <td>
                        <%#Eval("SurveyItemId")%>
                    </td>
                    <td align='left'>
                        <a href="SurveyOptionList.aspx?surveyId=<%#Eval("SurveyId") %>&itemId=<%#Eval("SurveyItemId") %>">
                            <%#Eval("ItemTitle")%></a>
                    </td>
                    <td>
                        <%#Eval("OrderNo") %>
                    </td>
                    <td>
                        <%#Convert.ToString(Eval("ItemType"))=="1" ? "单选" : (Convert.ToString(Eval("ItemType"))=="2" ? "多选" : "填空") %>
                    </td>
                    <td>
                        <%#Eval("CreateTime") %>
                    </td>
                    <td>
                        <asp:LinkButton ID="LinkButton2"  CommandName="ModifyItem" CommandArgument='<%#Eval("SurveyItemId") %>' runat="server">修改</asp:LinkButton> <a href="SurveyOptionList.aspx?surveyId=<%#Eval("SurveyId") %>&itemId=<%#Eval("SurveyItemId") %>"><%#Convert.ToString(Eval("ItemType"))!="3" ? "查看" : ""%></a> 
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr bgcolor="#ffffff">
            <td height="36" colspan="7">
                &nbsp; <a href="javascript:void(0);" id="chk_all" class="coolbg">全选</a> <a href="javascript:void(0);"
                    class="coolbg" id="chk_no">取消</a>
                <asp:LinkButton ID="LinkButton1" runat="server" class="coolbg" OnClick="LinkButton1_Click"
                    OnClientClick="return Del();">删除</asp:LinkButton><input id="txtIds" type="text" runat="server"
                        style="display: none" />
            </td>
        </tr>
    </table>
    
</asp:Content>
